home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / HELP.DIR / 00039_Script_39 < prev    next >
Text File  |  1996-03-28  |  3KB  |  123 lines

  1. --value of column--
  2. on left
  3.   return  the left of sprite the clickOn
  4. end left
  5.  
  6. on columnWidth numColumns
  7.   return (the width of sprite the clickOn)/numColumns
  8. end columnWidth
  9.  
  10. on getColumnValue H,L,numColumns
  11.   return  (H-L)/columnWidth(numColumns)
  12. end getColumnValue
  13.  
  14.  
  15. --value of row--
  16. on top
  17.   return the top of sprite the clickOn
  18. end top
  19.  
  20. on rowHeight numRows
  21.   return (the height of sprite the clickOn)/numRows
  22. end rowHeight
  23.  
  24. on getRowValue V,top,numRows
  25.   return  (V-top)/rowHeight(numRows)  
  26. end getRowValue
  27.  
  28. on getSerial column,row,numColumns 
  29.   return numColumns*row+column
  30. end getSerial
  31.  
  32.  
  33. on HelpText Horiz,V,numColumns,numRows,dataName
  34.   global topicSprite
  35.   set column=getcolumnValue(Horiz,left(),numColumns)
  36.  
  37.   set row=getrowValue(V,top(),numRows)
  38.   
  39.   
  40.   set aserial=getserial(column,row,numColumns) +1
  41.   
  42.   set helpTopic=line aserial of the text of cast dataName
  43.  
  44.   if not (helpTopic = "") then
  45.     HiliteIndexChoice column,Row,numColumns,numRows
  46.     
  47.     set the castNum of sprite topicSprite to the number of cast helpTopic
  48.     updateStage
  49.   end if
  50. end HelpText
  51.  
  52. -- Additional script by ET
  53.  
  54. on startMovie
  55.   global indexHiliteSprite, topicSprite
  56.   set indexHiliteSprite = 8
  57.   puppetSprite indexHiliteSprite, true
  58.   set topicSprite = 12
  59.   puppetSprite topicSprite, true
  60. end startMovie
  61.  
  62. -----------------
  63.  
  64. on getGridSquareCenter Pixels, NumSquares, Square
  65.   set SquareSize = Pixels / NumSquares 
  66.   return integer (Square * SquareSize - (SquareSize / 2))
  67. end getGridSquareCenter
  68.  
  69. -----------------
  70.  
  71. on hideIndexhilite
  72.   global indexHiliteSprite
  73.   puppetSprite indexHiliteSprite, false
  74.   updateStage
  75. end hideIndexhilite
  76.  
  77. on positionIndexHilite H, V
  78.   global indexHiliteSprite
  79.   set the locH of sprite indexHiliteSprite = H
  80.   set the locV of sprite indexHiliteSprite = V
  81.   updateStage
  82. end positionIndexHilite
  83.  
  84. on HiliteIndexChoice Col,Row,numColumns,numRows
  85.   put the ClickOn into gridSprite
  86.   set H = getGridSquareCenter (the width of sprite gridSprite, numColumns, Col+1)
  87.   set V = getGridSquareCenter (the height of sprite gridSprite, numRows, Row+1)
  88.   put H + the left of sprite gridSprite into H
  89.   put V + the top of sprite gridSprite into V
  90.   
  91.   positionIndexHilite H, V
  92.   
  93. end HiliteIndexChoice
  94. -------------------
  95. on returnFromIndex
  96.   global indexReturn
  97.   if (indexReturn = "") or (not stringP(indexReturn)) then
  98.     set indexReturn = "frame"&"e&"Contents""e&&"of movie"&"e&"Leonardo""e
  99.   end if
  100.   do "go"&&indexReturn
  101. end returnFromIndex
  102.  
  103.  
  104.  
  105. on fromLittleGuys SpriteName 
  106.   global indexHiliteSprite, topicSprite
  107.   puppetSprite indexHiliteSprite, false
  108.   puppetSprite topicSprite, false
  109.   updateStage
  110.   go SpriteName
  111. end fromLittleGuys
  112.  
  113. on toLittleGuys
  114.   global indexHiliteSprite, topicSprite
  115.   go "littleguys"
  116.   puppetSprite indexHiliteSprite, true
  117.   puppetSprite topicSprite, true
  118.   updateStage
  119. end toLittleGuys
  120.  
  121. on pauseFrame
  122.   go the frame
  123. end pauseFrame